package com.itdupan.controller;

import com.itdupan.config.JwtProperties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("admin")
@EnableConfigurationProperties(JwtProperties.class)
@RefreshScope
public class AdminController {

    private JwtProperties jwtProperties;

    @Value("${mybatis.type-aliases-package}")
    private String username;

    @GetMapping("getname")
    public String getStr() {

        return "Nacos配置中心获取的数据配置：" + username + jwtProperties.getSecret();
    }

}
